package ru.st.selenium.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

public class FilmAddPage extends InternalPage {
	
	public FilmAddPage(PageManager pages) {
		super(pages);
	}
	
	@FindBy(name = "name")
	private WebElement filmNameField;
	
    @FindBy(name = "year")
    private WebElement yearField;
    
    @FindBy(id = "submit")
    private WebElement submitButton;  
  
     public String getFilmName() {
	    return filmNameField.getAttribute("value");
	  }

	  public FilmAddPage setFilmNameField(String text) {
		  filmNameField.sendKeys(text);
	    return this;
	  }

	  public String getYear() {
	    return yearField.getAttribute("value");
	  }

	  public FilmAddPage setYearField(String text) {
		  yearField.sendKeys(text);
	    return this;
	  }

	public FilmAddPage clickSubmitButton() {
		submitButton.click();	
		return this;
	}

}
